#ifndef DBMS_H
#define DBMS_H

#include "DataBase.h"
#include "Debug.h"

#include <QVector>
#include <QString>
#include <QMap>

class DBMS
{
private:
    QString CurrentDB;
    QMap<QString, DataBase> ConnectedDBMap;
    QMap<QString, bool> DBMap;

    int SaveInfoToFile();
    int LoadInfoFromFileInfo();

    bool isConnected( const QString& DBName );

public:
    DBMS();

    int CreateDatabase( DataBaseInfo& Info );
    int RemoveDatabase( const QString& DBName );
    int RemoveAllDatabases();

    int ConnectDatabase( const QString& DBName );
    int DisconnectDatabse( const QString& DBName );

    int SetCurrentDatabase( const QString& DBName );
    DataBase* GetDatabase( const QString& DBName );
    DataBase* CurrentDatabase();

    //int GetDBNameVector( QVector<QString>& DBNameVector );
    void RestoreDefaultDatabases();
    void ChangeDatabaseInfo();

    ~DBMS();
};

#endif // DBMS_H
